<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
  </head>
  
  <body>
    <%@ include file = "top.jsp"  %>
    <div class="container">
		<div class="row">
			<div class="span3">
				<div class="well" style="padding: 8px 0;margin-top:70px;" >
					<ul class="nav nav-list">
						<li class="nav-header">${sessionScope.pu.project.name }</li>
						<li>${sessionScope.user.username }:${sessionScope.pu.role }</li>
						<li class="divider"></li>
						<li><a href="project.jspx?id=${sessionScope.pu.projectid }"><i class="icon-home"></i>最新动态</a></li>
						<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
						<li ><a href="document.jspx"><i class="icon-folder-open "></i>资料库</a></li>
						<li class="active"><a href="file.jspx"><i class="icon-file icon-white"></i>文件共享</a></li>
						<li ><a href="contact.jspx"><i class="icon-user"></i>联系人</a></li>
						<li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
						<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
						<li><a href="main.jspx?m=editProject&id=${pu.projectid }"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>
			</div>
			<div class="span9">
				<form action="file.jspx?m=addft" method="post" id="myform" style="margin-top:90px;">
					<fieldset>
						<legend>创建文件夹</legend>
						<div class="control-group">
							<label for="input01" class="control-label">文件夹名称</label>
							<div class="controls">
								<input type="text" class="span5" name="name" id="name" style="height:28px"/>
								<span style="color:red" id="name-msg"></span><br/>
							</div>							
						</div>
						
						<div class="control-group">
							<label for="input01" class="control-label">创建人</label>
							<div class="controls">
								<select name="manager" style="width:200px;height:28px">
								<!-- memberlist该项目的成员集合 -->
								<c:forEach items="${sessionScope.memeberlist}" var="m">
									<option value="${m.id}">${m.username}</option>
								</c:forEach>								
							</select>
							</div>
						</div>
						<div class="form-actions">
							<button type="button" id="btnSubmit" class="btn btn-primary">保存</button>
							<button class="btn" onclick="location.back()">返回</button>
						</div>
					</fieldset>
				
				</form>
			
			</div>
		</div>
	</div>
  </body>
  <script type="text/javascript">
		
		function validateName() {
			var name = document.getElementById("name").value;
			if(name.trim().length == 0) {
				return false;
			}
			return true;
		}		
		document.getElementById("name").onblur = function(){
			var result = validateName();
			if(!result) {
				document.getElementById("name-msg").innerHTML = "×文件夹名称不能为空";
			}
		};
		//当获得焦点，提示信息消失
		document.getElementById("name").onkeyup = function () {
			document.getElementById("name-msg").innerHTML = "";
		};
		
		document.getElementById("btnSubmit").onclick = function() {
			if(validateName()) {
				document.getElementById("myform").submit();
			} else {
				document.getElementById("myform").button();
			}
		};
	</script>
</html>
